package demo1;

/**
 * Created with IntelliJ IDEA.
 * User: 12629
 * Date: 2021/10/29
 * Time: 9:04
 * Description:
 */
abstract class Shape {
    public  abstract void draw();
}

/*abstract class A extends Shape {
    public abstract void funcA();
}
class B extends A {

    @Override
    public void draw() {

    }

    @Override
    public void funcA() {

    }
}*/

class Cycle extends Shape{

    @Override
    public void draw() {
        System.out.println("●");
    }
}

class Rect extends Shape{

    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
public class Test {

    public static void drawMap(Shape  shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        Cycle cycle = new Cycle();
        drawMap(cycle);
        drawMap(new Rect());
    }

}
